package projet.test;

import projet.dataaccess.JSON;
import projet.dataaccess.PathErrorException;
import projet.dataaccess.XML;
import junit.framework.TestCase;

/**
 * @author CORSINI Pierre
 *
 */
public class _TEST_XMLJSON extends TestCase
{
	private String str1 = "abc";
	private String path1 = "maison/chambre/armoire";
	
	public void testXML() throws PathErrorException
	{
		XML x = new XML();	
		x.addElement(path1, str1);
		try {
	
			assertTrue(x.getElementString(path1).equals(str1));
		} catch (PathErrorException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void testJSON()
	{
		JSON j = new JSON();
		try {
			j.addElement(path1, str1);
		} catch (PathErrorException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
			assertTrue(false);
		}
		try {
			assertTrue(j.getElementString(path1).equals(str1));
		} catch (PathErrorException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			assertTrue(false);
		}
			
	}
}
